<?=$this->load->view('include_header',null)?>
<style type="text/css">
form#form textarea {
    height: 50px;
    overflow: auto;
    padding: 5px;
    width: 410px;
}
</style>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/sg_update/'.$cateid)?>">

	<h3>新加坡申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  
		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />
			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td colspan="5"><strong>PART I – PARTICULARS OF APPLICANT 申请者信息</strong></td>
        </tr>
        <tr class="even">
            <td>Name:<br />
            	Name as in Travel Document<br />
姓名 (根据旅游证件格式,用英文填写）</td>
            <td><input type="text" name="name" value="<?= @$info->name?>" /></td>
            <td>&nbsp;</td>
            <td>Alias （别名）</td>
            <td><input type="text" name="alias" value="<?= @$info->alias?>" /></td>
        </tr>
        <tr class="odd">
            <td>Date of Birth:出生日期</td>
            <td nowrap="nowrap"><select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select> 
            日
            - 
			  <select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select> 
			  月 - 
			  <select name="birth_y"><?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select> 
			  年 </td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td></td>
        </tr>
        <tr class="even">
            <td>Sex:性别</td>
            <td><input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />
              Male 男
                <input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />
              Female 女</td>
            <td>&nbsp;</td>
            <td>Marital Status婚姻状况</td>
            <td>
<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?>/>
Single 单身  &nbsp;&nbsp;
<input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?>/>
Married 已婚<br />
<input type="radio" name="marital_status" value="3" <?= (@$info->marital_status==3)?'checked':''?>/>
Separated 分居
<input type="radio" name="marital_status" value="4" <?= (@$info->marital_status==4)?'checked':''?>/>
Divorced 离婚<br />
<input type="radio" name="marital_status" value="5" <?= (@$info->marital_status==5)?'checked':''?>/>
Widowed 丧偶</td>
        </tr>
        <tr class="odd">
            <td>Country of Birth:出生国家</td>
            <td><input type="text" name="birth_country" value="<?= @$info->birth_country?>" /></td>
			<td>&nbsp;</td>
			<td>State/Province of Birth:出生省份</td>
			<td><input type="text" name="birth_province" value="<?= @$info->birth_province?>" /></td>
			
        </tr>
        <tr class="even">
          <td>Race: (e.g. Malay, Indian,Chinese, Caucasian, etc) <br />种族（如 马来人、印度人、华人、欧亚人等）</td>
 <td><input type="text" name="race" value="<?= @$info->race?>" /></td>
			<td>&nbsp;</td>
			<td>Nationality:国籍</td>
			<td><input type="text" name="nationality" value="<?= @$info->nationality?>" /></td>
        </tr>
        <tr class="odd">
            <td>Type of Travel Document Held:所持旅游证件种类<br />
              (如：护照、身份证书、临时身份证明等)<br />
              (e.g. Passport, Certificate of Identity,Document of Identity, etc)</td>
            <td><input type="text" name="travel_document_type" value="<?= @$info->travel_document_type?>" /></td>
			<td>&nbsp;</td>
			<td>Travel Document No.:<br />
			  旅游证件号码</td>
			<td><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /></td>
        </tr>
        <tr class="even">
            <td>Travel Document<br />
              Issued Date: Expiry Date: 旅游证件签发日期</td>
            <td colspan="4"><input name="travel_document_issue_date" type="text" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /> 
			 Expiry Date有效期至 
				<input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
        </tr>
        <tr class="odd">
            <td>Country of Issue:签发国家</td>
            <td><input type="text" name="travel_document_issue_country" value="<?= @$info->travel_document_issue_country?>" /></td>
            <td>&nbsp;</td>
            <td>Place of Issue:签发地点</td>
            <td><input type="text" name="travel_document_issue_place" value="<?= @$info->travel_document_issue_place?>"  /></td>
        </tr>
        <tr class="even">
            <td>Address in Country of Origin <br />
              所属国家地址</td>
            <td colspan="4">Country of Origin:所属国家
              <input type="text" name="ori_country" value="<?= @$info->ori_country?>" />
              <br />
              Division/State/Province of Origin:所属省份 
              <input type="text" name="ori_province" value="<?= @$info->ori_province?>" />
              <br />
              Prefecture of Origin所属城市 
              <input type="text" name="ori_city" value="<?= @$info->ori_city?>" />
              <br />
              County/District of Origin所属县/区 
              <input type="text" name="ori_county" value="<?= @$info->ori_county?>" />
              <br />
              Address地址 
              <input name="ori_address" type="text" value="<?= @$info->ori_address?>" style="width:500px"/></td>
        </tr>
		        <tr class="odd">
            <td colspan="5"><strong>PART II –OTHER DETAILS 其他信息</strong></td>
        </tr>
        <tr class="even">
            <td>Occupation:职业</td>
            <td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
            <td>&nbsp;</td>
            <td>Highest Academic/Professional Qualifications Attained: 最高学历</td>
            <td><input type="text" name="academic" value="<?= @$info->academic?>" /></td>
        </tr>		
        <tr class="odd">
            <td>Religion/Denomination: 宗教信仰/宗派</td>
            <td colspan="4"><input name="religion" type="text" value="<?= @$info->religion?>" style="width:500px"/>			</td>
        </tr>
        <tr class="even">
            <td>Purpose of visit到访目的</td>
            <td colspan="4"><input name="purpose" type="text" value="<?= @$info->purpose?>" style="width:500px"/></td>
            
        </tr>
        <tr class="odd">
            <td>Date of Intended Arrival in Singapore / Period of Visa Applied For<br />预计到访新加坡的日期/欲申请签证的期限</td>
            <td colspan="4"><br />
			<input name="visa_period" type="text" value="<?= @$info->visa_period?>" style="width:500px"/></td>
        </tr>
        <tr class="even">
            <td>How long do you intend to stay in Singapore ?<br />您预计在新加坡居留多久？</td>
            <td colspan="4">
			<input type="radio" name="intend_stay" value="1" <?= (@$info->intend_stay==1)?'checked':''?>/> Up to 30 days 最多30天  &nbsp;
			<input type="radio" name="intend_stay" value="2" <?= (@$info->intend_stay==2)?'checked':''?>/> More than 30 days 超过30天</td>
        </tr>

        <tr class="odd">
            <td>If your intended stay in Singapore is more <br />
              than 30 days, please state the reason for <br />
              your intended length of stay and the duration. <br />
              若您预计将在新加坡居留超过30天，请说明理由并注明您将居留的期限。</td>
            <td colspan="4">
              <textarea name="stay_reason"><?= @$info->stay_reason?></textarea>
            </td>
        </tr>
        <tr class="even">
            <td>Nationality of Spouse:配偶国籍</td>
            <td colspan="4">
<input type="radio" name="spouse_nationality" value="1" <?= (@$info->spouse_nationality==1)?'checked':''?>/>
Singapore Citizen 新加坡公民  &nbsp;
<input type="radio" name="spouse_nationality" value="2" <?= (@$info->spouse_nationality==2)?'checked':''?>/>
Singapore Permanent Resident 新加坡永久居民<br />
<input type="radio" name="spouse_nationality" value="3" <?= (@$info->spouse_nationality==3)?'checked':''?>/>
Others (Please Specify)其他（请注明）   &nbsp;&nbsp;
<input name="spouse_nationality_other" type="text" value="<?= @$info->spouse_nationality_other?>" /></td>
        </tr>
        <tr class="odd">
            <td>Address in Singapore 在新加坡的地址</td>
            <td colspan="4">Where will you be staying in Singapore ?* 您将在新加坡何处住宿？<br />
<input type="radio" name="stay_where" value="1" <?= (@$info->stay_where==1)?'checked':''?>/>
Next-of-kin’s Place直系亲属处              &nbsp;
<input type="radio" name="stay_where" value="2" <?= (@$info->stay_where==2)?'checked':''?>/>
Relative’s Place 亲戚处
<input type="radio" name="stay_where" value="3" <?= (@$info->stay_where==3)?'checked':''?>/>
Friend’s Place 朋友处  &nbsp;<br />
<input type="radio" name="stay_where" value="4" <?= (@$info->stay_where==4)?'checked':''?>/>
Hotel 酒店              &nbsp;
<input type="radio" name="stay_where" value="5" <?= (@$info->stay_where==5)?'checked':''?>/>
Others (Please Specify)其他（请注明）&nbsp;&nbsp;<input name="stay_where_other" type="text" value="<?= @$info->stay_where_other?>" />
<br />
Block/House No.（楼号）:<input name="house_no" type="text" value="<?= @$info->house_no?>" style="width:20px" />  
Floor No. （楼层）:   &nbsp;&nbsp; <input name="floor_no" type="text" value="<?= @$info->floor_no?>" style="width:20px" />  
Unit No.（门号）: :  &nbsp; <input name="unit_no" type="text" value="<?= @$info->unit_no?>" style="width:20px" />
<br />
Postal Code（邮编）: &nbsp;&nbsp; &nbsp;&nbsp;<input name="postal_code" type="text" value="<?= @$info->postal_code?>" style="width:40px" />  
&nbsp;&nbsp;Street Name街道名字:&nbsp;&nbsp; &nbsp; <input name="postal_street" type="text" value="<?= @$info->postal_street?>" />
<br />
Building Name大楼名称:&nbsp;&nbsp; &nbsp; <input name="postal_building" type="text" value="<?= @$info->postal_building?>" style="width:300px" /></td>
        </tr>
        <tr class="even">
            <td colspan="5">Did you reside in other countries, other than your country of origin, for one year or more during the last 5 years ?*<br />
            您是否在过去5年内，除了在您所属国家外，在其他国家居留一年或以上？&nbsp;&nbsp;&nbsp;&nbsp; 
			<input type="radio" name="is_last5year" value="1" <?= (@$info->is_last5year==1)?'checked':''?>/>  Yes 是&nbsp;&nbsp;
			<input type="radio" name="is_last5year" value="0" <?= (@$info->is_last5year==0)?'checked':''?>/> No 否<br />
If yes, please furnish details 若是，请提供相关详情<br />
Country 国家 <input name="last5year1_country" type="text" value="<?= @$info->last5year1_country?>" style="width:60px" />  &nbsp;&nbsp;
Address 地址 <input name="last5year1_address" type="text" value="<?= @$info->last5year1_address?>" style="width:240px" /> &nbsp;&nbsp; 
From 从<input name="last5year1_from" type="text" value="<?= @$info->last5year1_from?>" style="width:60px" /> 
To 至 <input name="last5year1_to" type="text" value="<?= @$info->last5year1_to?>" style="width:60px" />
<br />
Country 国家 <input name="last5year2_country" type="text" value="<?= @$info->last5year2_country?>" style="width:60px" />  &nbsp;&nbsp;
Address 地址 <input name="last5year2_address" type="text" value="<?= @$info->last5year2_address?>" style="width:240px" /> &nbsp;&nbsp; 
From 从<input name="last5year2_from" type="text" value="<?= @$info->last5year2_from?>" style="width:60px" /> 
To 至 <input name="last5year2_to" type="text" value="<?= @$info->last5year2_to?>" style="width:60px" />
<br />
Country 国家 <input name="last5year3_country" type="text" value="<?= @$info->last5year3_country?>" style="width:60px" />  &nbsp;&nbsp;
Address 地址 <input name="last5year3_address" type="text" value="<?= @$info->last5year3_address?>" style="width:240px" /> &nbsp;&nbsp; 
From 从<input name="last5year3_from" type="text" value="<?= @$info->last5year3_from?>" style="width:60px" /> 
To 至 <input name="last5year3_to" type="text" value="<?= @$info->last5year3_to?>" style="width:60px" />
<br /></td>
        </tr>
        <tr class="odd">
            <td colspan="5"><strong>PART III – ANTECEDENT OF APPLICANT * 申请人申请背景</strong></td>
            
        </tr>
        <tr class="even">
            <td colspan="3">(a) Have you ever been refused entry into or deported from any country, including Singapore? <br />
              您是否曾被任何国家（包括新加坡）拒绝入境或遣返回国？</td>
			 <td colspan="2">
<input type="radio" name="is_q1" value="1" <?= (@$info->is_q1==1)?'checked':''?>/>
Yes 是&nbsp;&nbsp;
<input type="radio" name="is_q1" value="0" <?= (@$info->is_q1==0)?'checked':''?>/>
No 否</td>
        </tr>
        <tr class="odd">
            <td colspan="3">(b) Have you ever been convicted in a court of law in any country, including Singapore? <br />
              您是否曾在任何国家（包括新加坡）的法律下被宣判有罪？</td>
			<td colspan="2">
<input type="radio" name="is_q2" value="1" <?= (@$info->is_q2==1)?'checked':''?>/>
Yes 是&nbsp;&nbsp;
<input type="radio" name="is_q2" value="0" <?= (@$info->is_q2==0)?'checked':''?>/>
No 否</td>
        </tr>
        <tr class="even">
            <td colspan="3">(c) Have you ever been prohibited from entering Singapore? <br />
              您是否曾被禁止进入新加坡？</td>
            <td colspan="2">
<input type="radio" name="is_q3" value="1" <?= (@$info->is_q3==1)?'checked':''?>/>
Yes 是&nbsp;&nbsp;
<input type="radio" name="is_q3" value="0" <?= (@$info->is_q3==0)?'checked':''?>/>
No 否</td>
        </tr>
        <tr class="odd">
            <td colspan="3">(d) Have you ever entered Singapore using a different passport or name? Yes 是No 否<br />
              您是否曾用其他名字或护照进入新加坡？</td>
            <td colspan="2">
<input type="radio" name="is_q4" value="1" <?= (@$info->is_q4==1)?'checked':''?>/>
Yes 是&nbsp;&nbsp;
<input type="radio" name="is_q4" value="0" <?= (@$info->is_q4==0)?'checked':''?>/>
No 否</td>
        </tr>
        <tr class="even">
            <td colspan="5">If any of the answer is “YES”, please furnish details on a separate sheet of paper. 若以上任何一个问题答案为“是”，请用另一页纸提供详情。</td>
            
        </tr>
       
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		name:"required",
		sex:"required",
		marital_status:"required",
		birth_country:"required",
		birth_province:"required",
		race:"required",
		nationality:"required",
		travel_document_type:"required",
		travel_document_num:"required",
		travel_document_issue_date:"required",
		travel_document_valid_date:"required",
		travel_document_issue_country:"required",
		travel_document_issue_place:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);
	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>